local function getupvaluetable(func, inname)
    local i = 1
    while true do
        local name, value = debug.getupvalue(func, i)
        if name == nil then
            return
        end
        
        if name == inname then
            return i,value
        end
        
        i=i+1
    end
end


local lua = _P.lua
local idx, old_events = getupvaluetable(lua.handler.trigger,'events')

print_r(old_events)

local function on_coins_change(charge_data)
    print_r(charge_data)
    local uid = charge_data.uid
    R().hallsvr{key=uid}:send('.msg_handler','on_recharge',charge_data)

    --通知首冲事件
    R().hallsvr({key=uid}):send('.msg_handler', 'frist_charge_rate',uid,charge_data.pay_coins,charge_data.charge_count)
end

old_events.on_coins_change = on_coins_change

print("success========")